﻿@using SmartStore.Web.Models.Search;
@model SearchBoxModel
@{
    if (IsStoreClosed)
    {
        return;
    }

    var labelStyle = GetThemeVariable<string>("search-button-style", "primary");
    if (GetThemeVariable<bool>("search-button-flat"))
    {
        labelStyle += " btn-flat";
    }
}
<form action="@Model.SearchUrl" class="instasearch-form" method="get">
	<input type="text"
			class="instasearch-term form-control"
			name="q"
			value="@Model.CurrentQuery"
			placeholder="@Model.InputPlaceholder"
		    data-instasearch="@(Model.InstantSearchEnabled ? "true" : "false")"
			data-minlength="@(Model.SearchTermMinimumLength.ToString())"
			data-showthumbs="@(Model.ShowThumbsInInstantSearch.ToString().ToLower())"
			data-url="@Model.InstantSearchUrl"
            data-origin="@Model.Origin"
			@(Model.InstantSearchEnabled ? Html.Raw(" autocomplete=\"off\"") : null) />

	<button type="submit" class="btn btn-@labelStyle btn-icon instasearch-button" title="@T("Search")">
		<i class="icm icm-magnifier instasearch-icon"></i>
	</button>

	<div class="instasearch-drop">
		<div class="instasearch-drop-body clearfix"></div>
	</div>

    @{ Html.RenderWidget("searchbox"); }
</form>